<?php if(!IS_AJAX){?>

<include file="Public:header" />
<div class="row">
  <div class="col-sm-7 col-md-8 col-lg-9">
    <section class="panel">
      <div class="panel-body">
        <table class="table table-bordered" width="100%" border="0" cellspacing="0" cellpadding="0">
          <thead>
            <tr>
             
              <td align="center">网站名称</td>
              <td align="center">状态</td>
              <td align="center" width="200">操作</td>
            </tr>
          </thead>
          <tbody class="ajaxdatalist" id="ajaxdatalist">
            <?php }?>
            
            
            
            <?php if(IS_AJAX){?>
            <!-- 数据主体 -->
            
            <volist name="list" id="vo">
              <tr class="data_list" id="ajaxdatalist-{$vo.id}">
                
                <td><p><span class="ajaxText" tablename="Site" field="title" id="{$vo.id}" val="{$vo.title}">{$vo.title}</span></p>
                  <if condition="$vo['agent'] eq 1 && getAccessMenu($accessList, 'Admin', 'Site', 'setagent')">
                    <p>平台余额：<span style="color:#f00; font-size:18px; font-weight:bold;">¥{$vo.balance}</span></p>
                  </if>
                  <p>{$vo.remark}</p>
                  <p>{$vo.domain}</p>
                  <p>{:date('Y-m-d',$vo['timeout'])}</p>
                  <p>
                    <volist name="vo['userlist']" id="svo"> <a href="{:U('User/edit', array('id' => $svo['id']))}" target="_blank">{$svo.nickname}</a> 、 </volist>
                  </p></td><td align="center"><input updateurl="{:U('ajaxUpdate')}" field="status,{$vo.id}" type="checkbox" 
                    <eq name="vo['status']" value="1">checked="checked"</eq>
                    class="js-switch-teal"/></td>
                <td align="left" class="option">
                
                
                
                <if condition="getAccessMenu($accessList, 'Admin', 'Site', 'renew')"> <a class="btn btn-success" onClick="mydialog.open('{:U('renew', array('id'=>$vo['id']))}', {width: 500, height: 300,lock:true,title:'产品续费'})" href="javascript:void(0);">续费</a> </if>
                <div class="btn-group">
                                            <button data-toggle="dropdown" class="btn btn-primary dropdown-toggle" type="button">更多操作 <span class="caret"></span></button>
                                            <ul role="menu" class="dropdown-menu">
                                              <if condition="getAccessMenu($accessList, 'Admin', 'Pages', 'edit')">  <li> <a class="" href="{:U('Pages/edit', array('id' => $vo['page_id'], 'siteid' => $vo['id']))}" title="{:getTemplateName($vo['page_id'])}" target="_blank">首页布局</a> </li></if>
                                              
                                              
                                              
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                                                
                  
                  <if condition="getAccessMenu($accessList, 'Admin', 'Site', 'resetPages')"> <li><a target="_blank" href="{:U('resetPages', array('id'=>$vo['id']))}" onClick="return confirm('此操作将修复站点页面错误的数据，耗费较多资源，您确定要这样做吗？');">整理页面</a></li> </if>
                  <if condition="getAccessMenu($accessList, 'Admin', 'Site', 'copy')"> <li><a target="_blank" href="javascript:void(0);" onClick="mydialog.open('{:U('copy', array('id' => $vo['id']))}',{width: 500, height: 200,lock:false,title:'复制站点'});">复制站点</a></li> </if>
                  <if condition="getAccessMenu($accessList, 'Admin', 'Site', 'Conf')"> <li><a href="javascript:void(0);" onClick="_openWindow('{:U('Conf',array('id'=>$vo['id']))}', 800, '站点设置', '保存', function(){ $('#ajaxdatalistform').trigger('submit');}, '');">站点设置</a></li> </if>
                  <if condition="getAccessMenu($accessList, 'Admin', 'Site', 'edit')"> <li><a href="javascript:void(0);" onClick="_openWindow('{:U('edit',array('id'=>$vo['id']))}', 800, '绑定域名', '保存', function(){ $('#ajaxdatalistform').trigger('submit');}, '');">绑定域名</a></li> </if>
                  <if condition="getAccessMenu($accessList, 'Admin', 'Site', 'delete')"> <li><a href="javascript:void(0);" rel="{:U('delete',array('id'=>$vo['id']))}" class="deleteBtn" data-id="{$vo.id}">删除站点 </a></li> </if>
                  <if condition="getAccessMenu($accessList, 'Admin', 'Site', 'selectUser')"> <li><a href="javascript:void(0);" onclick="mydialog.open('{:U('selectUser',array('id' => $vo['id']))}', {width: 800, height: 500,lock:true,title:'编辑用户'})">管理用户</a> </li></if>
                  <if condition="getAccessMenu($accessList, 'Admin', 'Site', 'setagent')">
                    <li><if condition="$vo['agent'] eq 0"> <a href="{:U('setagent',array('id'=>$vo['id']))}" onclick="return confirm('确定要设置代理吗？');">设为代理</a>
                      <else/>
                      <a class="btn btn-success btn-sm" href="{:U('setagent',array('id'=>$vo['id']))}" onclick="return confirm('确定要取消代理吗？');"><span style="color:#f00">取消代理</span></a>
                      <if condition="getAccessMenu($accessList, 'Admin', 'Site_balance_log', 'index')"> <a href="{:U('Site_balance_log/index',array('id'=>$vo['id']))}" target="_blank">平台资金明细</a> </if>
                    </if></li>
                  </if>
                                                
                                                
                                                
                                                
                                                
                                            </ul>
                                        </div>
                
                
                
                
                
                
                
                
                
                
                
                
                
                
                </td>
              </tr>
            </volist>
            <?php }?>
            <!-- 数据主体结束 -->
            
            <?php if(!IS_AJAX){?>
          </tbody>
        </table>
        <div id="ajaxdatalistpages"></div>
      </div>
    </section>
  </div>
  <div class="col-sm-5 col-md-4 col-lg-3">
    <div class="states-info">
      <div class="panel green-bg">
        <div class="panel-body">
          <div class="row">
            <div class="col-xs-3"> <i class="fa fa-hand-o-right"></i> </div>
            <div class="col-xs-7">
              <h4>添加站点</h4>
              <span class="state-title"> <a class="text-success" href="##" onClick="_openWindow('<?php echo U('add');?>', 800, '添加站点', '保存', function(){ $('#ajaxdatalistform').submit();}, '');">点击这里添加站点</a> </span> </div>
            <div class="col-xs-2"> <span class="fa fa-angle-right"></span> </div>
          </div>
        </div>
      </div>
    </div>
    <div class="panel">
      <header class="panel-heading"> 搜索 </header>
      <div class="panel-body">
        <form id="ajaxdatalistform">
          <div class="input-group m-bot15">
            <input type="text" name="keywords" class="form-control">
            <span class="input-group-btn">
            <button type="button" onClick="$('#ajaxdatalistform').trigger('submit');" class="btn btn-default"><i class="fa fa-search"></i></button>
            </span> </div>
        </form>
        <div id="FlatTree" class="tree tree-plus-minus">
          <div class = "tree-folder" style="display:none;">
            <div class="tree-folder-header"> <i class="fa fa-folder"></i>
              <div class="tree-folder-name"></div>
            </div>
            <div class="tree-folder-content"></div>
            <div class="tree-loader" style="display:none"></div>
          </div>
          <div class="tree-item" style="display:none;"> <i class="tree-dot"></i>
            <div class="tree-item-name"></div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<include file="Public:footer" />

</body></html><?php }?>
